<template>
    <b-container fluid="xl" class="app">
        <div class="title">
            <ul>
                <li class="boll-li"></li>
                <li class="boll-li"></li>
                <li class="boll-li"></li>
                <li class="boll-li"></li>
            </ul>
            <h1>数字化网络基础设施</h1>
        </div>
        <div class="container">
            <div class="container-border">
                <slider ref="slider" :options="options" @slide="slide">
                    <!-- slideritem wrapped package with the components you need -->
                    <slideritem v-for="(item,index) in data" :key="index" :style="item.style">
                        <div class="item" :class="current === index ? 'item-current' : ''">
                            <p :style="{color: item.background}">{{ item.number }}</p>
                            <div class="boll" :stlye="{'--background': item.background}" :class="'boll' + index"></div>
                        </div>
                    </slideritem>
                    <!-- Customizable loading -->
                    <div slot="loading">loading...</div>
                </slider>
            </div>

            <transition name="slide-fade" v-for="(item,key) in data" :key="key">
                <div class="desc" v-show="current === key">
                    <ul class="left" :class="current === key ? 'desc_active_' + key : ''">
                        <li><h1>{{ item.number }}</h1>
                            <p>家</p></li>
                        <li><p>{{ item.desc }}</p></li>
                    </ul>
                    <ul class="right">
                        <li><p>{{ item.title }}</p></li>
                        <li><p>{{ item.container }}</p></li>
                    </ul>
                </div>
            </transition>
        </div>
    </b-container>
</template>

<script>
import { slider, slideritem } from 'vue-concise-slider'

export default {
    name: "facilities",
    components: {
        slider,
        slideritem
    },
    data () {
        return {
            options: {
                currentPage: 0,
                pagination: false,
                centeredSlides: true
            },
            current: 0,
            data: [
                {
                    number: 4,
                    background: '#3553E2',
                    desc: '国家专线采购来源',
                    title: '国际专线直通全球多点',
                    container: '花卷国际专线采购来源覆盖中国电信、中国联通、腾讯云、阿里云、PCCW 等中国与海外大型互联网基础服务提供商。集众多优质资源于一身，为客户提供最适合的服务。目前，花卷国际专线可直达洛杉矶、东京、首尔、中国香港、法兰克福。'
                },
                {
                    number: 16,
                    background: '#4B9E65',
                    desc: '主流数据交换中心会员',
                    title: '花卷网络海外覆盖 16 家主流数据交换中心',
                    container: '花卷网络海外可达位于亚洲、美西、美东、美中、拉丁美洲、欧洲的 16 家大型互联网交换中心。通过花卷网络与全球内容提供商 / 运营商交换数据更快速。目前可达 HKIX，Equinix HK，Any2 Los angeles，Seattle IX，AMS-IX，DE-CIX（Dusseldorf/Frankfurt/Munich/Hamburg），LINX（London），LoNAP，PTT São Paulo，PITER-IX，Data IX，Global-IX，KCIX。'
                },
                {
                    number: 200,
                    background: '#F8CE5E',
                    desc: '带宽资源',
                    title: '100Gbps 带宽资源覆盖全球多地',
                    container: '位于中国、亚洲、美西、美东、美中、拉丁美洲、欧洲的 16 家大型互联网交换中心带宽已达200 Gbps。'
                },
                {
                    number: 16,
                    background: '#CE5B4D',
                    desc: '国家专线采购来源',
                    title: '国际专线直通全球多点',
                    container: '花卷国际专线采购来源覆盖中国电信、中国联通、腾讯云、阿里云、PCCW 等中国与海外大型互联网基础服务提供商。集众多优质资源于一身，为客户提供最适合的服务。目前，花卷国际专线可直达洛杉矶、东京、首尔、中国香港、法兰克福。'
                }
            ]
        }
    },
    methods: {
        slide (e) {
            this.current = e.currentPage
        }
    }
}
</script>

<style scoped lang="scss">
.app {
    .title {
        margin-top: 60px;

        ul {
            display: flex;
            margin-bottom: 50px;

            .boll-li {
                width: 18px;
                height: 18px;
                border-radius: 18px;
                margin-bottom: 12px;
                margin-right: 10px;
            }

            .boll-li:first-child {
                background: #CE5B4D;
            }

            .boll-li:nth-child(2) {
                background: #F8CE5E;
            }

            .boll-li:nth-child(3) {
                background: #4B9E65;
            }

            .boll-li:nth-child(4) {
                background: #598CEE;
            }
        }

        h1 {
            font-size: 68px;
            font-weight: bold;
        }
    }

    .container {
        margin-top: 150px;
        height: 400px;

        .container-border {
            width: 100%;
            position: relative;

            .slider-container {
                .slider-item {
                    width: 100px;
                    height: 100%;
                    min-height: 1px;
                    margin-right: 70px;

                    .item {
                        display: -webkit-box;
                        display: -ms-flexbox;
                        display: flex;
                        -webkit-box-orient: vertical;
                        -webkit-box-direction: normal;
                        -ms-flex-flow: column;
                        flex-flow: column;
                        -webkit-box-pack: end;
                        -ms-flex-pack: end;
                        justify-content: flex-end;
                        -webkit-box-align: center;
                        -ms-flex-align: center;
                        align-items: center;
                        position: relative;
                        height: 250px;
                        text-align: center;
                        padding-bottom: 90px;

                        p {
                            font-size: 18px;
                            color: #3553E2;
                        }

                        .boll {
                            background: #3553E2;
                            width: 20px;
                            height: 20px;
                            border-radius: 50%;
                            position: absolute;
                            top: 190px;
                        }

                        .boll1 {
                            background: #4B9E65;
                        }

                        .boll2 {
                            background: #F8CE5E;
                        }

                        .boll3 {
                            background: #CE5B4D;
                        }
                    }

                    .item-current {
                        p {
                            font-weight: bold;
                            font-size: 120px;
                            transition: font-size .25s;
                        }

                        .boll:after {
                            width: 50px;
                            height: 50px;
                            border-radius: 50%;
                            content: '';
                            position: absolute;
                            left: -15px;
                            bottom: -15px;
                            background: rgba(53, 83, 226, 0.5);
                        }

                        .boll1:after {
                            width: 50px;
                            height: 50px;
                            border-radius: 50%;
                            content: '';
                            position: absolute;
                            left: -15px;
                            bottom: -15px;
                            background: rgba(75, 158, 101, .5);
                        }

                        .boll2:after {
                            width: 50px;
                            height: 50px;
                            border-radius: 50%;
                            content: '';
                            position: absolute;
                            left: -15px;
                            bottom: -15px;
                            background: rgba(248, 206, 94, .5);
                        }

                        .boll3:after {
                            width: 50px;
                            height: 50px;
                            border-radius: 50%;
                            content: '';
                            position: absolute;
                            left: -15px;
                            bottom: -15px;
                            background: rgba(206, 91, 77, .5);
                        }

                        .boll:before {
                            width: 80px;
                            height: 80px;
                            border-radius: 50%;
                            content: '';
                            position: absolute;
                            background: rgba(53, 83, 226, 0.1);
                            left: -30px;
                            bottom: -30px;
                        }

                        .boll:before {
                            width: 80px;
                            height: 80px;
                            border-radius: 50%;
                            content: '';
                            position: absolute;
                            background: rgba(53, 83, 226, 0.1);
                            left: -30px;
                            bottom: -30px;
                        }

                        .boll1:before {
                            width: 80px;
                            height: 80px;
                            border-radius: 50%;
                            content: '';
                            position: absolute;
                            background: rgba(75, 158, 101, .1);
                            left: -30px;
                            bottom: -30px;
                        }

                        .boll2:before {
                            width: 80px;
                            height: 80px;
                            border-radius: 50%;
                            content: '';
                            position: absolute;
                            background: rgba(248, 206, 94, .1);
                            left: -30px;
                            bottom: -30px;
                        }

                        .boll3:before {
                            width: 80px;
                            height: 80px;
                            border-radius: 50%;
                            content: '';
                            position: absolute;
                            background: rgba(206, 91, 77, .1);
                            left: -30px;
                            bottom: -30px;
                        }
                    }
                }
            }
        }

        .container-border:after {
            content: "";
            position: absolute;
            bottom: 50px;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            height: 1px;
            background: #ccc;
        }

        .active_0 {
            font-size: 120px !important;
            top: -250px !important;
            left: -20px;
        }

        .active_1 {
            font-size: 120px !important;
            top: -250px !important;
            left: -60px;
        }

        .active_2 {
            font-size: 120px !important;
            top: -250px !important;
            left: -90px;
        }

        .active_3 {
            font-size: 120px !important;
            top: -250px !important;
            left: -60px;
        }

        .desc_active_0 {
            color: #3553E2 !important;
        }

        .desc_active_1 {
            color: #4B9E65 !important;
        }

        .desc_active_2 {
            color: #F8CE5E !important;
        }

        .desc_active_3 {
            color: #CE5B4D !important;
        }

        .desc {
            margin-top: 100px;
            display: flex;

            .left {
                width: 40%;
                color: #3553E2;

                li:first-child {
                    display: flex;

                    p {
                        line-height: 58px;
                        margin-left: 20px;
                    }
                }
            }

            .right {
                flex: 1;
                margin-top: 20px;

                li:first-child {
                    font-size: 22px;
                }

                li:last-child {
                    margin-top: 20px;
                    font-size: 18px;
                }
            }
        }
    }
}
</style>
